<?php if ($this->controller == 'admin' && $this->method === 'edit'): ?>
<h3><?php echo sprintf(lang('cirpho_group_edit_title'), $owner->name);?></h3>
<?php else: ?>
<h3><?php echo lang('cirpho_group_create_title');?></h3>
<?php endif; ?>

<?php echo form_open($this->uri->uri_string(), 'class="crud" id="owners"'); ?>
<fieldset>
	<ol>
		<li class="even">
		<label for="title"><?php echo lang('cirpho_group_title_label');?></label>
		<?php echo  form_input('title', $group->title); ?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		</li>
		
		<li class="odd">
		<label for="owner_id"><?php echo lang('cirpho_group_owner_label');?></label>
		<?php
			$ownerOptions = array();
			if(isset($owners) && count($owners) > 0){
				foreach ($owners as $owner){
					$ownerOptions[$owner->id] = $owner->name;
				}
			}
			echo form_dropdown('owner_id', $ownerOptions, $group->owner_id);
		?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		</li>
		
		<li class="even">
		<label for="category_id"><?php echo lang('cirpho_group_category_label');?></label>
		<?php
			$categoryOptions = array();
			if(isset($categories) && count($categories) > 0){
				foreach ($categories as $category){
					$categoryOptions[$category->id] = $category->name;
				}
			}
			echo form_dropdown('category_id', $categoryOptions, $group->category_id);
		?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		</li>
		<li class="odd">
		<label for="valid"><?php echo lang('cirpho_group_valid_label');?></label>
		<?php echo form_checkbox('valid', 1, $group->valid?TRUE:FALSE);?>
		</li>
		<li class="even">
		<label for="comment"><?php echo lang('cirpho_group_comment_label');?></label>
		<?php echo  form_input('comment', $group->comment); ?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		</li>
		
		<li class="odd">
		<label for="url"><?php echo lang('cirpho_group_url_label');?></label>
		<?php echo  form_input('url', $group->url); ?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		</li>
		<li class="even">
		<label for="note"><?php echo lang('cirpho_group_note_label');?></label>
		<?php echo  form_textarea('note', $group->note); ?>
		<span class="required-icon tooltip"><?php echo lang('required_label');?></span>
		</li>
	</ol>

	<div class="buttons float-left padding-top">
		<?php $this->load->view('admin/partials/buttons', array('buttons' => array('save', 'cancel') )); ?>
	</div>
</fieldset>

<?php echo form_close(); ?>